package imdbfolder.tests;

import imdbfolder.data.Movie;
import imdbfolder.workers.MovieInfoFetcher;
import junit.framework.TestCase;

public class MovieInfoFetcherTest extends TestCase {

    public void testFetchMovie() throws Exception {
        Movie movie = new Movie();
        movie.setImdbId("tt0460791");

        MovieInfoFetcher fetcher = new MovieInfoFetcher(movie);
        movie = fetcher.onWork();

        assertEquals(2006, movie.getYear());
        assertEquals("8.0", movie.getScore());
        assertEquals("8,040", movie.getNumVotes());
        assertEquals("Adventure, Drama, Fantasy", movie.getGenres());
        assertEquals("In a hospital on the outskirts of 1920s Los Angeles, an injured stuntman begins to tell a fellow patient, a little girl with a broken arm, a fantastical story about 5 mythical heroes. Thanks to his fractured state of mind and her vivid imagination, the line between fiction and reality starts to blur as the tale advances.", movie.getPlotSummary());
    }
}
